#ifndef SK_MEDIA_DMR_H_
#define SK_MEDIA_DMR_H_
#include "PltUPnP.h"
#include "PltMediaRenderer.h"
#include "PltStateVariable.h"
#include "NptNetwork.h"
#include <unistd.h>
#include <stdlib.h>
#include "DidlMetaDataSafeParser.h"

#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
//#include <fcntl.h>
//#include <string.h>

#include "PltFileMediaServer.h"
#include "DlnaCommon.h"

class PLT_MediaRendererDelegate_android: public PLT_MediaRendererDelegate
{
public:
    virtual ~PLT_MediaRendererDelegate_android() {}

    // ConnectionManager
    virtual NPT_Result OnGetCurrentConnectionInfo(PLT_ActionReference& action) ;

    // AVTransport
    virtual NPT_Result OnNext(PLT_ActionReference& action) ;
    virtual NPT_Result OnPause(PLT_ActionReference& action) ;
    virtual NPT_Result OnPlay(PLT_ActionReference& action) ;
    virtual NPT_Result OnPrevious(PLT_ActionReference& action) ;
    virtual NPT_Result OnSeek(PLT_ActionReference& action) ;
    virtual NPT_Result OnStop(PLT_ActionReference& action) ;
    virtual NPT_Result OnSetAVTransportURI(PLT_ActionReference& action) ;
    virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action) ;

    // RenderingControl
    virtual NPT_Result OnSetVolume(PLT_ActionReference& action) ;
    virtual NPT_Result OnSetVolumeDB(PLT_ActionReference& action) ;
    virtual NPT_Result OnGetVolumeDBRange(PLT_ActionReference& action) ;
    virtual NPT_Result OnSetMute(PLT_ActionReference& action) ;
    virtual NPT_Result OnSetMediaPair(PLT_ActionReference& action) ;
    virtual NPT_Result OnsetTvPlay(PLT_ActionReference& action) ;

    //////////////////
    virtual NPT_Result OnGetTransportInfo(PLT_ActionReference& action) ;
    virtual NPT_Result OnGetPositionInfo(PLT_ActionReference& action);
	virtual NPT_Result OnGetMediaInfo(PLT_ActionReference& action);
	virtual NPT_Result OnGetVolume(PLT_ActionReference& action);
	virtual NPT_Result OnGetProtocolInfo(PLT_ActionReference& action);
	virtual NPT_Result OnBindDTVDevice(PLT_ActionReference& action);
	virtual NPT_Result OnGetChannelGroupID(PLT_ActionReference& action);

    //////////////////
    virtual void ResetDmrState();
    virtual NPT_Result SetRenderingControlVolume(const char * state);
    virtual NPT_Result SetRenderingControlMute(const char * state);
    virtual NPT_Result SetAVTransportCurrentMediaDuration(const char * state);
    virtual NPT_Result SetAVTransportAbsoluteTimePosition(const char * state);
 //    virtual NPT_Result SetRenderingControlPair();
    //////////////////
    virtual NPT_Result SetAVTransportState(const char * state);
    virtual NPT_Result SetAVTransportState(const char * state,bool isSentEvent);
    virtual NPT_String GetAVTransportState();
    virtual NPT_Result SetAVUriMetadata(NPT_String track,NPT_String uri,NPT_String metadata);
    virtual NPT_String GetCurrentMediaDuration();
    virtual NPT_String GetAVTransportPosition();
    virtual NPT_String GetRenderingControlVolume();
    virtual NPT_String GetAVTransportUri();
    virtual NPT_String GetAVTransportMetadata();
    virtual NPT_Result SetChannelGroupID(const char * channelid);
    virtual NPT_String GetChannelGroupID();

};
void PltRenderSetup(const char  *friendlyname, const char *uid_tail);
void PltRenderStop();
PLT_MediaRendererDelegate_android *getMediaRender();
void setDurationEnable(bool isEnable);
#endif
